home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!news
- From: Amit Ramon <amitra@ix.netcom.com>
- Newsgroups: comp.lang.c++
- Subject: Re: help with bytes -> long
- Date: Sun, 10 Mar 1996 21:06:22 -0600
- Organization: Netcom
- Message-ID: <314398AE.923@ix.netcom.com>
- References: <4hl3mh$oue@frodo.smartlink.net>
- NNTP-Posting-Host: ix-stl4-25.ix.netcom.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-NETCOM-Date: Sun Mar 10 9:04:56 PM CST 1996
- X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
-
- Thomas Hackbarth wrote:
- >
- > I suck at bit manipulation. I need a macro to convert RGB to a long so I
- > get this output
- >
- > RED GREEN BLUE -> LONG
- > FF 00 FF FF 00 FF 00
- >
- > Using Windows RGB macro I get this
- >
- > RED GREEN BLUE -> COLORREF
- > FF 00 FF 00 FF 00 FF
- >
- > Anyone have any good Ideas?
- >
- > Thanks
- > Thomas
- >
- >
-
- This piece of code should do it:
-
- COLORREF clr = RGB (FF, 0, FF);
- long l = clr << 8;
-
- Amit.
-